<template>


  <div>

    <div style="height: 100px;margin-top: 0px ">
      <div style="float: left;width: 70%;height: 100%">
        <p style="color: black;font-size: 23px;line-height: 23px;font-weight: bold;height: 40px;margin-left: 40%">--  项目情况  --</p>
      </div>
      <div style="float: left;width: 30%;height: 100%">
        <!--<el-button  v-if="this.states===0" type="success" style="margin-bottom: 20px" round @click="jumpp()">发起项目申请</el-button>-->
        <el-button type="success" style="margin-bottom: 20px" round @click="jumpp()">查看项目进度安排</el-button>

      </div>
    </div>










      <div >
        <div style="width: 50%;height:630px;margin-left: 15%;background-color: white;position:absolute">
          <div style="height: 30px;">
            <p style="line-height: 5px;font-size:19px ">完整项目情况</p>
          </div>
          <div style="bheight: 350px;width: 100%; position: relative">
            <div style="width: 50%;height: 300px;float: left;margin-top: 20px">
              <img :src="this.photoUrl" style="width: 300px;height: 300px;margin-left: 25%">
            </div>
            <div style="width: 50%;height: 300px;float: left;margin-top: 20px">
              <div  style="width: 400px;height:300px" >
                <p  style="width: 400px;word-wrap: break-word;height: 25px;line-height: 10px" >项目名：   {{projectName}}</p>
                <p  style="width: 400px;word-wrap: break-word;height: 25px;line-height: 10px">项目属性：  {{ lable}}</p>
                <p  style="width: 400px;word-wrap: break-word;height: 25px;line-height: 10px">报价：  {{price}}</p>
                <p  style="width: 400px;word-wrap: break-word;height: 25px;line-height: 10px">工期：  {{timeLimit}}</p>
                <p  style="width: 400px;word-wrap: break-word;height: 25px;line-height: 10px" v-if="this.style===0">外包形式：项目外包</p>
                <p  style="width: 400px;word-wrap: break-word;height: 25px;line-height: 10px" v-if="this.style===1">外包形式：人员内招</p>
                <p  style="width: 400px;word-wrap: break-word;height: 300px;line-height: 20px" > 简介:   {{introduce}} <a :href=this.projectDoc ><p>点我下载项目详细文档</p></a>    </p>
              </div>
            </div>
          </div>

          <div style="height: 30px;position: relative;margin-top: 370px">
            <p style="line-height: 20px;font-size:19px ">项目文档</p>
          </div>

          <div style="height: 150px;position: relative">
            <div >

             <a :href=this.projectDoc style="text-decoration: none" ><p style="line-height: 10px;text-align: left;margin-left: 140px;color: #59df17">点我下载任务描述详细文档</p></a>
              <a :href=this.projectDoc style="text-decoration: none" ><p style="line-height: 10px;text-align: left;margin-left: 140px;color: #59df17">点我下载开发规范</p></a>
            </div>
          </div>

        </div>
      </div>













  </div>


</template>

<script>
  export default {
    data() {
      return {


        tdid:'',
        ff:'',
        id:'',
        projectName:'',
        lable:'',
        introduce:'',
        photoUrl:'',
        price:'',
        projectDoc:'',
        timeLimit:'',
        style:'',


        states:'',
        tid:'',
        pid:'',
        teamData:[
          {
          id:'',
          price:'',
          demand:'',
          doc:'',
          photo:'',
          workroomName:'',
          puanduan:'',
          }
        ]
      }
    },
    mounted: function(){
      // /workroom/insertWorkroomProgress

      this.pid=this.$route.query.mallCode3
      this.tid = this.$route.query.mallCode
      var user= JSON.parse(window.sessionStorage.getItem("user"));
      var ff=user.id
      axios.post('/workroom/selectTeamDemandByTW',{
            tid:this.tid,
            wid:ff
      }).then((response) => {
        if( response.data != null){
          ///workroom/insertTeamDemand
          var e=response.data


          this.tdid=e.id



          // var data=[];
          //
          // for(var c=0;c<e.length;c++){
          //   var ee=e[c]
          //   var eee=ee.teamDemand
          //   var eeee=ee.workRoom
          //
          //   var obj={}
          //
          //   obj.id=eee.id
          //   obj.price=eee.price
          //   obj.demand=eee.demand
          //   obj.doc=eee.doc
          //
          //   if(eee.wid!=0){
          //     obj.photo=eeee.photoUrl
          //     obj.workroomName=eeee.workroomName
          //     obj.puanduan=1
          //   }else{
          //     obj.photo=eee.photo
          //     obj.puanduan=0
          //   }
          //   data[c]=obj
          //   console.log(obj)}
          //
          // this.teamData=data

          this.findProject();

        }
        else{
          // this.$notify({
          //   title: '失败',
          //   message: '错误',
          //   type: 'warning',
          //   duration:2000
          // });
        }
      })

    },
    methods: {


      findProject(){
        axios.post('/user/findProjectById',{
          id: this.pid,
          states: this.pid
        }).then((response) => {
          if(response.data!=""){

            var user= JSON.parse(window.sessionStorage.getItem("user"));
            var jj=user.role

            if(jj.includes("workroom")){
              this.ff=true

            }
            var e=response.data
            this.projectName=e.projectName
            this.lable=e.lable
            this.price=e.price
            this.style=e.style
            this.introduce=e.introduce
            this.projectDoc=e.projectDoc
            this.photoUrl=e.photoUrl
            var a=e.timeLimit
            var b= a.split("T")
            this.timeLimit=b[0]


          }
          else{

          }

        }).catch((response)=>{
          this.$notify.error({
            title: '',
            message: '错误'
          });
        })

      },



      jumpp(path) {
        console.log(this.tdid)
        this.$router.push({
          path: '/WorkroomEchart',
          query: {
            mallCode:this.tdid,
            mallCode2:1
          }
        })


      },
      // jumpppp(path) {
      //   console.log(path)
      //   this.$router.push({
      //     path: '/WorkroomEchart',
      //     query: {
      //       mallCode: path,
      //     }
      //   })
      //
      //
      // },


      jumppp(){




        axios.post('/user/selectOrderByTid',{
          tid:this.tid,
          id:this.tid
        }).then((response) => {
          if( response.data != null){
            var e=response.data
            console.log(e)

            var ee=e.id

            this.$router.push({
              path: '/Echart',
              query: {
                mallCode: ee,
              }
            })


          }
          else{

          }
        })








      },

      jump(path) {
        console.log(path)
        this.$router.push({
          path: '/TeamMemberDemand',
          query: {
            mallCode: this.tid,
          }
        })


      },


    }}
</script>



<style scoped>
  .image {
    width: 100%;
    display: block;
  }
</style>
